Ext.define('Admin.view.employee.EmployeeAddForm', {
    extend: 'Ext.form.Panel',
    xtype:'employeeAddForm',
    requires: [
        'Ext.button.Button',
        'Ext.layout.container.*',
        'Ext.form.*'
    ],
    style: 'margin:10px',
    width:600,
    height:800,
    defaults: {
        labelWidth: 60,
        labelSeparator: ''
    },
    controller: 'employeeViewController',
    reader:{  
    type:'json',  
    model:'Admin.model.employee.EmployeeModel',  
    rootProperty : 'employee',  
    successProperty:'success'  
},
    items: [{
            xtype: 'container',
            anchor: '100%',
            layout:'column',
            items:[{
                xtype: 'container',
                columnWidth:.6,
                layout: 'anchor',
                    items: [{
                        xtype: 'textfield',   
                        allowBlank: false,
                        maxLength: 10,
                        name: 'user.userName',
                        fieldLabel: '用户名',
                        blankText: '请输入用户名',
                        maxLengthText: '用户名不能超过10个字符'
                      },{
                        xtype: 'textfield',   
                        allowBlank: false,
                        maxLength: 10,
                        name: 'user.password',
                        fieldLabel: '密码',
                        blankText: '请输入密码',
                        maxLengthText: '密码不能少于6位'
                      },{
                        xtype: 'textfield',   
                        allowBlank: false,
                        maxLength: 10,
                        name: 'empName',
                        fieldLabel: '姓名',
                        blankText: '请输入姓名',
                        maxLengthText: '姓名不能超过10个字符'
                      },{
                        xtype:'radiogroup',
                        fieldLabel: '性别',
                        
                        style: 'padding-top:3px;height:17px;',
                        items: [{ name: 'sex', inputValue: 'male', boxLabel: '男', checked: true }, { name: 'sex', inputValue: 'female', boxLabel: '女'}]
                      },
                      {
                        xtype:'combobox',
                    
                        allowBlank: false,
                        fieldLabel: '岗位',
                        store:{
                                proxy: {
                                type: 'ajax',
                                url:'post/findAll',
                                reader: {
                                    type: 'json',
                                    rootProperty: 'lists'
                                }
                                },
                                fields: [ 'postId', 'postName']
                        },
                        displayField: 'postName',
                        valueField: 'postId',
                        name:'post.postId',
                        emptyText: '请选择...',
                        blankText: '请选择岗位',
                        Addable: false,
                        mode: 'local' 
                      },
                      {
                        xtype: 'textfield',     
                        
                      
                        name: 'ethnic',
                        fieldLabel: '民族',
                         blankText: '请输入民族'
                      },{
                        xtype: 'textfield',     
                        
                     
                        name: 'education',
                        fieldLabel: '学历',
                        blankText: '请输入学历'
                      },{
                        xtype: 'textfield',     
                    
                        maxLength: 18,
                      
                        name: 'idcard',
                        fieldLabel: '身份证',
                        blankText: '请输入身份证',
                        maxLengthText: '18位数身份证'
                      },{   
                        xtype: 'textfield',     
                    
                      
                        name: 'phone',
                        fieldLabel: '联系电话'
                                 
                      },{   
                        xtype: 'textfield',     
                    
                    
                        name: 'email',
                        fieldLabel: '邮箱'
                                 
                      },{
                    
                        xtype: 'textfield',
                     
                        name: 'bornPlace',
                        fieldLabel: '出生地'
                     },{
                        xtype: 'textfield',
                    
                        name: 'address',
                        fieldLabel: '联系地址'
        
                    },{
                        xtype: 'datefield',
                        
                        fieldLabel: '入职时间',
                        name:'joinTime',
                        format: 'Y/m/d'
                    }]
            }]
            // ,{
            //     xtype: 'container',
            //     columnWidth:.4,
            //     layout: 'vbox',
            //     items: [{
            //           xtype: 'box', //或者xtype: 'component',  
            //             width: 120, //图片宽度  
            //             height: 160, //图片高度  
            //             autoEl: {  
            //                 tag: 'img',    //指定为img标签  
            //                 src: 'myphoto.gif'    //指定url路径  
            //             } 
                       
            //     },{
            //         xtype:'button',
            //         text: '上传照片'

                   
            //     }]
            // }
            
        }],

        buttons: [{
            text: 'submit',
            handler:'submitAddForm'
        },{
            text: 'Cancel',
            handler :function(bt){
            var win = bt.up('window');
            if (win) {
                win.close();
            }
          }
        }]
    
});